<?php
require '../../../php/database_login.php';
$return = [];
$sql = "select * from `multipack_model` where `pic`='{$_POST['arr']['img']}' limit 1";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$value=explode('#', $row['style_name'])[0];


$sql = "select * from `multipack_model` where `sort`='{$row['sort']}' and `style_name` like '%{$value}%' and `topic`='{$row['topic']}'";
$result = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_assoc($result)) {
    $return[] = $row;
}

echo json_encode($return);
